package example1;

import java.math.BigDecimal;

/**
 * <h3>designPattern</h3>
 * <p>满减策略</p>
 * @author : zhang.bw
 * @date : 2020-06-04 17:42
 **/
public class OverDiscountStrategy implements DiscountStrategy {

	@Override
	public BigDecimal getDiscount(BigDecimal total) {
		// 满100减20优惠
		return total.compareTo(BigDecimal.valueOf(100)) >= 0 ? BigDecimal.valueOf(20) : BigDecimal.ZERO;
	}
}
